package com.frcdi.qms.equipment.mapper;

import com.frcdi.qms.equipment.domain.EquipmentCycle;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 设备生命周期Mapper接口
 *
 * @author cell
 * @date 2023-12-12
 */
public interface EquipmentCycleMapper
{
    /**
     * 查询设备生命周期
     *
     * @param cycleStatus 设备生命周期主键
     * @return 设备生命周期
     */
    public EquipmentCycle selectEquipmentCycleByCycleStatus(String cycleStatus);

    /**
     * 查询设备生命周期列表
     *
     * @param equipmentCycle 设备生命周期
     * @return 设备生命周期集合
     */
    public List<EquipmentCycle> selectEquipmentCycleList(EquipmentCycle equipmentCycle);

    /**
     * 新增设备生命周期
     *
     * @param equipmentCycle 设备生命周期
     * @return 结果
     */
    public int insertEquipmentCycle(EquipmentCycle equipmentCycle);

    /**
     * 批量新增生命周期信息
     *
     * @param cycleList 用户角色列表
     * @return 结果
     */
    public int batchCycle(List<EquipmentCycle> cycleList);

    /**
     * 通过设备ID删除关联
     *
     * @param equipmentId 设备ID
     * @return 结果
     */
    public int deleteCycleByEquipmentId(Long equipmentId);

    public int deleteCycleByEquipmentIds(Long[] equipmentIds);

    /**
     * 通过设备ID查询使用数量
     *
     * @param equipmentId 设备ID
     * @return 结果
     */
    public int countCycleById(@Param("equipmentId") Long equipmentId,@Param("cycleStatus") String cycleStatus);
}
